#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(void)
{
    int mat1[2][3];
    int mat2[3][4];
    int mat3[2][4];
    int i, j;
    
    // srand()放置于for循环之前
    srand((unsigned)time(NULL));
    for(i=0; i<2; i++)
    {
        for(j=0; j<3; j++)
        {
            mat1[i][j] = rand()%100;
            printf("Random number: mat1[%d][%d] - %d. \n", i, j, mat1[i][j]);
        }
    }
    
    for(i=0; i<3; i++)
    {
        for(j=0; j<4; j++)
        {
            mat2[i][j] = rand()%100;
            printf("Random number: mat2[%d][%d] - %d. \n", i, j, mat2[i][j]);
        }
    }
    
    return 0;
}

